#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll ans, sx, sy, n;
int main()
{
    cin >> n;

    for (int i = 0; i < n; ++i)
    {
        int x, y;
        cin >> x >> y;
        ans += (n - 1) * (x * x + y * y) - ((x * sx + y * sy) * 2);
        sx += x, sy += y;
    }
    cout << ans;
    return 0;
}